-
Notifications
You must be signed in to change notification settings - Fork 115
Implement P2248R8: Enable list-initialization for algorithms #2398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Yes. Let's do that for all algorithms, including - if necessary - non-standard ones in oneDPL. |
|
Is the intention to merge this for milestone 2022.10.0? |
Whenever we think it's ready |
d0441d2 to
f1b47c6
Compare
danhoeflinger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the question on replace_copy, I don't see any issues with the implementation, but I have not yet checked the tests.
test/parallel_api/algorithm/alg.modifying.operations/replace_copy.pass.cpp
Show resolved
Hide resolved
test/parallel_api/algorithm/alg.modifying.operations/replace_copy.pass.cpp
Outdated
Show resolved
Hide resolved
Tests for hetero backend remain
- remove the default template argument from replace_copy that was added by mistake - remove runtime tests for replace_copy but keep compile-time ones - remove redundant pair of curly braces where applicable - improve the messages for static assert
205dc35 to
a7c545f
Compare
danhoeflinger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor wording issues only (and the clang-formatting suggestion).
If you prefer to keep "shall" over "must", that is OK.
LGTM, will reapprove after changes
test/parallel_api/algorithm/alg.modifying.operations/remove_copy.pass.cpp
Outdated
Show resolved
Hide resolved
test/parallel_api/algorithm/alg.modifying.operations/replace_copy.pass.cpp
Outdated
Show resolved
Hide resolved
danhoeflinger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
|
The fixes so far look good. |
73c3ab2 to
1dc25f2
Compare
1dc25f2 to
c087a2d
Compare
|
Let me highlight the next moment. As far as I understand this PR implement some changes according to the future C++ specifications. Is it OK ? |
Correct. Users who prefer to keep their source code base compatible with the current and previous versions of the C++ standard should not use braced-list arguments for the standard algorithms. Even after C++26 is published and implemented, previous (already released) versions of the standard libraries won't support this ability. oneDPL will still support C++17/20/23, meeting (most of) the requirements for parallel algorithms in these standards. The change does not introduce incompatibilities there. |
SergeyKopienko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The link to the proposal
Implementing Iterator-based algorithms only. Ranges-based implementation is going on separately.
There are no breaking changes. All the breaking changes in C++ standard come into
std::rangesnamespace but even they are irrelevant to oneDPL because we implement list-initialization enabling right away, so there is no template parameters swappingThere are two oversights for P2248:
find_lastwas not included (see this paper). However, it's irrelevant for Iterator-based algorithms becausefind_lastexists instd::ranges:namespace onlyuninitialized_fillwas not included (see this paper. However, it's not included for C++26 yet. I've implemented that proactively as was requested. There is a NB comment to include this oversight for C++26.Binary Search-like algorithms from P2248 (e.g.,
lower_bound,upper_bound, etc.) are not relevant either because our API for those does not haveT-like template parameter.Linked issue: #1508